package ar.com.personalTravellers.generators.runner;

import ar.com.personalTravellers.daos.factory.PTDAOFactory;
import ar.com.personalTravellers.generators.*;
import ar.com.personalTravellers.spring.ApplicationContextSpring;
import com.angel.data.generator.DataGeneratorRunner;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

/**
 * @author William
 */
public class PTDataGeneratorRunnerDAO extends HibernateDaoSupport{

    public PTDataGeneratorRunnerDAO(){
        super();
    }

    public void initializeDataInformation(){
        PTDAOFactory ptDAOFactory = (PTDAOFactory) ApplicationContextSpring.createInstance().prepareApplicationContext().getBean("ptDAOFactory");
        DataGeneratorRunner runner = new DataGeneratorRunner(ptDAOFactory);
        runner.addDataGeneratorClass(RoleDataGenerator.class);
        runner.addDataGeneratorClass(NeighborhoodFileDataGenerator.class);
        runner.addDataGeneratorClass(RoomFileDataGenerator.class);
        runner.addDataGeneratorClass(ConfigurationParameterDataGenerator.class);
        runner.addDataGeneratorClass(LanguageDataGenerator.class);
        runner.addDataGeneratorClass(HotelFileDataGenerator.class);
        runner.addDataGeneratorClass(HotelRoomsFileDataGenerator.class);
        runner.addDataGeneratorClass(CountryFileDataGenerator.class);
        runner.addDataGeneratorClass(HotelDescriptionInternationalizableDataGenerator.class);
        runner.addDataGeneratorClass(HotelContactsFileDataGenerator.class);
        runner.addDataGeneratorClass(UserDataGenerator.class);
        runner.generateData();
    }
}